package com.dandev.cmdemo.service;

import java.util.List;

import com.dandev.cmdemo.form.Communique;
import com.dandev.cmdemo.form.Contact;

/**
 * Transaction level non direct data manipulation
 * 
 * @author Dan
 *
 */
public interface ContactService {
	
	/**
	 * Adds a news contact if contact.id is null or updates and existing one.
	 * @param contact data to updated or insert.
	 */
    public void addContact(Contact contact);
	
    /**
	 * Returns all contacts, contacts can have many contacts this is a non-lazy get.
	 * @return all contacts.
	 */
    public List<Contact> listContact();
    
    /**
     * Get a specific contact does not load communiques.
     * @param id of the contact to get
     * @return loaded Contact
     */
    public Contact getContact(Long id); 
    
    /**
     * Get a specific contact 
     * @param id of the contact to get
     * @param loadComm if true will load all communiques for this contact
     * @return Contact
     */
    public Contact getContact(Long id, boolean loadComm); 
    
    /**
     * Removes a contact
     * @param id
     */
    public void removeContact(Long id);
    
    /**
     * Add a communique
     * @param comm the Communique to add
     */
    public void addCommunique(Communique comm);
    
    /**
     * Get Communique
     * @param id of Communique to get
     * @return Communique
     */
    public Communique getCommunique(Long id);
    
    /**
     * Remove Communique
     * @param id of Communique to remove
     */
    public void removeCommunique(Long id);

}
